home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zoom 2
/
Zoom - Release 2 (1996)(Active Software)[!].iso
/
texts
/
dosman121
/
man
/
ask
< prev
next >
Wrap
Text File
|
1995-05-05
|
2KB
|
55 lines
Ask(V1.3 in C:) (v 2.x & 3.x internal)
NAME
Ask - Query user interactively.
SYNOPSIS
Ask Prompt WARN OK TIMEOUT
DESCRIPTION
Ask is a program that allows you to get a simple form
of input from a user. It is most useful in Execute
scripts.
You may specify a Prompt string, which will be
displayed to the user, and you may also specify a string
to match on for both YES and NO responses, as well as
specifying a time limit on the users response in seconds.
All of these strings have default values, the default for
the WARN string is 'Y', the default for the OK string is
'N', and the default for the Prompt is a single question
mark.
If the user enters a string which matches the WARN
string, Ask will exit with a return code that will cause
an IF WARN statement to succeed. If the user enters a
string which matches the OK string, exceeds the value
given in TIMEOUT, or simply hits RETURN then Ask will
exit with a ZERO return, suitable for the ELSE portion of
such an IF statement.
More simply: A 'yes' returns a 5. A 'no' returns a 0.
If the user enters a string other than those
specified in WARN and OK, then ASK will redisplay the
prompt, urging the user to give a better answer.
EXAMPLE
Here is an example of an Ask command which will
return a WARNING if the user types "Amiga", and an OK if
the user types "BigBlue", or waits longer than 10 seconds
to respond:
Ask "Amiga or BigBlue?" "Amiga" "BigBlue" Timeout 10
IF WARN ; typed amiga!
Echo "Obviously a person of quality"
ELSE ; typed big blue? or couldn't decide
Echo "You seem to be misguided"
ENDIF